﻿<phone:PhoneApplicationPage xmlns:PhoneControls="clr-namespace:Coding4Fun.PhoneControls;assembly=Coding4Fun.PhoneControls" 
	x:Class="Coding4Fun.PanoHead.MainPage"
	xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
	xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
	xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
	xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
	xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
	xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
	mc:Ignorable="d"
	d:DataContext="{d:DesignData SampleData/PanoViewModelSampleData.xaml}"
	FontFamily="{StaticResource PhoneFontFamilyNormal}"
	FontSize="{StaticResource PhoneFontSizeNormal}"
	Foreground="{StaticResource PhoneForegroundBrush}"
	SupportedOrientations="Portrait"  Orientation="Portrait"
	shell:SystemTray.IsVisible="True" Loaded="PhoneApplicationPage_Loaded">
	<phone:PhoneApplicationPage.Resources>
		<Style TargetType="PhoneControls:IntegerTextBox">
			<Setter Property="Margin" Value="0,-14,0,14"/>
		</Style>
	</phone:PhoneApplicationPage.Resources>

	<!--LayoutRoot is the root grid where all page content is placed-->
	<Grid x:Name="LayoutRoot">
		<!-- LOCALIZATION NOTE:
			To localize the displayed strings copy their values to appropriately named
			keys in the app's neutral language resource file (AppResources.resx) then
			replace the hard-coded text value between the attributes' quotation marks
			with the binding clause whose path points to that string name.

			For example:

				Text="{Binding Path=LocalizedResources.ApplicationTitle, Source={StaticResource LocalizedStrings}}"

			This binding points to the template's string resource named "ApplicationTitle".

			Adding supported languages in the Project Properties tab will create a
			new resx file per language that can carry the translated values of your
			UI strings. The binding in these examples will cause the value of the
			attributes to be drawn from the .resx file that matches the
			CurrentUICulture of the app at run time.
		 -->
		<Popup x:Name="popConnect" Width="250" Height="80">
			<Border BorderThickness="1" BorderBrush="Red" Background="#7F830000" Width="250" Height="80">
				<StackPanel VerticalAlignment="Center" HorizontalAlignment="Center"  >
					<TextBlock Text="Attempting to connect...." HorizontalAlignment="Left" Margin="0,0,0,14"></TextBlock>
					<ProgressBar IsIndeterminate="True" VerticalAlignment="Center" Visibility="Visible"/>
				</StackPanel>
			</Border>
		</Popup>
		<StackPanel x:Name="mainPanel" Margin="24,24,24,0">
			<StackPanel x:Name="TitlePanel" Orientation="Horizontal" Margin="0,0,0,29">
				<Image Grid.Row="0" Grid.Column="0" Source="/Assets/Images/c4funlogo.png" Width="37" HorizontalAlignment="Left" VerticalAlignment="Top" />
				<TextBlock Grid.Row="0" Grid.Column="1" Text="{Binding Path=LocalizedResources.ApplicationTitle, Source={StaticResource LocalizedStrings}}" Style="{StaticResource PhoneTextNormalStyle}" HorizontalAlignment="Left" VerticalAlignment="Center" Margin="8,0,12,0" />
			</StackPanel>
			<Grid>
				<Grid.RowDefinitions>
					<RowDefinition Height="auto"/>
					<RowDefinition Height="auto"/>
					<RowDefinition Height="auto"/>
					<RowDefinition Height="auto"/>
					<RowDefinition Height="auto"/>
					<RowDefinition Height="auto"/>
					<RowDefinition Height="auto"/>
					<RowDefinition Height="auto"/>
				</Grid.RowDefinitions>
				<Grid.ColumnDefinitions>
					<ColumnDefinition Width="*"/>
					<ColumnDefinition Width="120"/>
				</Grid.ColumnDefinitions>
				<TextBlock Text="Turn time" Grid.Row="0" Grid.Column="0"/>
				<TextBlock Text="Settle time" Grid.Row="2" Grid.Column="0"/>
				<TextBlock Text="Pause time" Grid.Row="4" Grid.Column="0"/>
				<TextBlock Text="Iterations" Grid.Row="6" Grid.Column="0"/>
				<PhoneControls:IntegerTextBox Grid.Row="1" Grid.Column="1" Text="{Binding TurnTime, Mode=TwoWay}"/>
				<PhoneControls:IntegerTextBox Grid.Row="3" Grid.Column="1" Text="{Binding SettleTime, Mode=TwoWay}"/>
				<PhoneControls:IntegerTextBox Grid.Row="5" Grid.Column="1" Text="{Binding PauseTime, Mode=TwoWay}"/>
				<PhoneControls:IntegerTextBox Grid.Row="7" Grid.Column="1" Text="{Binding Iterations, Mode=TwoWay}"/>
				<Slider Width="300" Grid.Row="1" Grid.Column="0" HorizontalAlignment="Left" Value="{Binding TurnTime, Mode=TwoWay}" Maximum="3000" LargeChange="300" SmallChange="30" VerticalAlignment="Top" />
				<Slider Width="300" Grid.Row="3" Grid.Column="0" HorizontalAlignment="Left" Value="{Binding SettleTime, Mode=TwoWay}" Maximum="10000" LargeChange="1000" SmallChange="100" VerticalAlignment="Top" />
				<Slider Width="300" Grid.Row="5" Grid.Column="0" HorizontalAlignment="Left" Value="{Binding PauseTime, Mode=TwoWay}" Maximum="10000" LargeChange="1000" SmallChange="100" VerticalAlignment="Top"/>
				<Slider Width="300" Grid.Row="7" Grid.Column="0" HorizontalAlignment="Left" Maximum="72" Minimum="1" LargeChange="6" SmallChange="1" Value="{Binding Iterations, Mode=TwoWay}" VerticalAlignment="Top" />
			</Grid>
			<Button x:Name="buttonPano" Content="Go!" Click="buttonPano_Click"/>
			<TextBlock Text="{Binding Status}" Margin="0,20,0,0" HorizontalAlignment="Center"/>
		</StackPanel>
		<!--Uncomment to see an alignment grid to help ensure your controls are
            aligned on common boundaries.  The image has a top margin of -32px to
            account for the System Tray. Set this to 0 (or remove the margin altogether)
            if the System Tray is hidden.

            Before shipping remove this XAML and the image itself.-->
		<!--<Image Source="/Assets/AlignmentGrid.png" VerticalAlignment="Top" Height="800" Width="480" Margin="0,-32,0,0" Grid.Row="0" Grid.RowSpan="2" IsHitTestVisible="False" />-->
	</Grid>
</phone:PhoneApplicationPage>